package com.cq.company.service;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.cq.company.entity.TB_CompanyBusinessInformation;
import com.cq.company.mapper.CompanyBusinessInformationMapper;
import com.cq.feignapi.clients.UserClients;
import com.cq.feignapi.entity.TB_User;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
@Transactional
@Slf4j
public class CompanyBusinessInformationService extends ServiceImpl<CompanyBusinessInformationMapper, TB_CompanyBusinessInformation> {

    @Autowired
    UserClients userClients;

    public TB_CompanyBusinessInformation getCompany() {
        TB_CompanyBusinessInformation entity = this.baseMapper.selectById("5022327383646924800");
        TB_User user = userClients.getUser();
        com.cq.company.entity.TB_User vo = new com.cq.company.entity.TB_User();
        BeanUtils.copyProperties(user,vo);
        entity.setUser(vo);
        return entity;
    }

}